// 窗口类
import { nanoid } from 'nanoid'
export default class Window{
    // 窗口优先级
    priority
    // 窗口宽度
    width
    // 窗口高度
    height
    // 窗口偏移量
    offset_left
    // 窗口偏移量
    offset_top
    // 窗口绑定的进程id
    processId
    // 窗口Id
    windowId
    constructor(processId = null,width = 0,height = 0,offset_left = 0,offset_top = 0,priority = 0){
        this.processId = processId 
        if(!this.processId) console.error('please bind the processId for window')
        if(width<0) console.error('width cannot miner than zero')
        if(height<0) console.error('height cannot miner than zero')
        this.width = width
        this.height = height
        this.offset_left = offset_left
        this.offset_top = offset_top
        this.priority = priority
        this.windowId= nanoid().replace(/[0-9-]/g).replace(/undefined/g,'')
    }
    setPriority(priority){
        this.priority = priority
    }
    getWindowId(){
        return this.windowId
    }
}